#!/usr/bin/env node

const fs = require('fs');
const src = process.argv[2];
      

let w = fs.watch(src,(evt,file)=>{
  console.log(`${file}:${evt}`);
});

process.on('SIGINT',() => {
  w.close();

  console.log('unwitch the directory');
  console.log('Game over after 5 second');

  setTimeout(() => {
    process.exit();
  },5000);
})
